package com.woniu.smart.controller;

import com.woniu.smart.entity.Visit;
import com.woniu.smart.service.VisitService;
import com.woniu.smart.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ：zhuboyuan
 * @date ：Created in 2022/10/31 11:03
 * @description：c{description}
 * @modified By：
 * @version: $
 */
@RestController
@RequestMapping("visits")
public class VisitController {
    @Autowired
    private VisitService visitService;

    @GetMapping("")
    public Result queryAll(){
        List<Visit> visits = visitService.selectAll();
        return Result.ok().data("visitList",visits);
    }
}
